//
// C:\Program Files (x86)\FlashDevelop\Tools\flexsdk\frameworks\libs\player\10.0\playerglobal.swc\Point
//
package flash.geom
{
	public class Point
	{
		private var _x:Number;
		private var _y:Number;
		
		public function Point (x:Number = 0, y:Number = 0) {
			_y = y;
			_x = x;
			
		}

		
		public function get x () : Number { return _x; }
		public function set x (value:Number) : void { _x = value; }


		public function get y () : Number { return _y; }
		public function set y (value:Number) : void { _y = value; }

		public function get length () : Number
		{
			return Math.sqrt(_x * _x + _y * _y);
		}

		public function add (v:Point) : Point {
			return new Point(_x + v.x, _y + v.y);
		}

		public function clone () : Point
		{
			return new Point(_x, _y);
		}

		
		public static function distance (pt1:Point, pt2:Point) : Number
		{
			var x:Number = pt1.x - pt2.x;
			var y:Number = pt1.y - pt2.y;
			return Math.sqrt(x * x + y * y);
		}

		
		public function equals (toCompare:Point) : Boolean;
		{
			return _x == toCompare.x && _y == toCompare.y;
		}

		public static function interpolate (pt1:Point, pt2:Point, f:Number) : Point
		{
			return null;
		}

		public function normalize (thickness:Number) : void {
			var scale:Number = thickness / length
			_x *= scale;
			_y *= scale;
		}

		
		public function offset (dx:Number, dy:Number) : void {
			_x += dx;
			_y += dy;
		}

		
		public static function polar (len:Number, angle:Number) : Point
		{
			return null;
		}


		public function subtract (v:Point) : Point{
			return new Point(_x - v.x, _y - v.y);
		}

		
		public function toString () : String {
			return "[object Point]";
		}
	}
}
